Skip to content

DOC: Improved the docstring of pandas.Series.dt.components #20177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 8, 2018

Conversation

ijmbarr
Copy link
Contributor

@ijmbarr ijmbarr commented Mar 10, 2018

Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):

  • PR title is "DOC: update the docstring"
  • The validation script passes: scripts/validate_docstrings.py <your-function-or-method>
  • The PEP8 style check passes: git diff upstream/master -u -- "*.py" | flake8 --diff
  • The html version looks good: python doc/make.py --single <your-function-or-method>
  • It has been proofread on language by another sprint participant

Please include the output of the validation script below between the "```" ticks:

################################################################################
################### Docstring (pandas.Series.dt.components)  ###################
################################################################################

Return a Dataframe of the components of the Timedeltas.

Provides a dataframe with the components of each of the timedeltas with
the same length and index as the original Series, and columns:

(days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds)

Returns
-------
a : pandas.DataFrame

Examples
--------
>>> s = pd.Series(pd.to_timedelta(np.arange(5), unit='s'))
>>> s
0   00:00:00
1   00:00:01
2   00:00:02
3   00:00:03
4   00:00:04
dtype: timedelta64[ns]
>>> s.dt.components
   days  hours  minutes  seconds  milliseconds  microseconds  nanoseconds
0     0      0        0        0             0             0            0
1     0      0        0        1             0             0            0
2     0      0        0        2             0             0            0
3     0      0        0        3             0             0            0
4     0      0        0        4             0             0            0

################################################################################
################################## Validation ##################################
################################################################################

Errors found:
        See Also section not found

If the validation script still gives errors, but you think there is a good reason
to deviate in this case (and there are certainly such cases), please state this
explicitly.

This commit fails PEP 8 due to lines of length 81 in example - I can split this over multiple rows, but I feel this obscures the example. I'm happy to change if you disagree.

Checklist for other PRs (remove this part if you are doing a PR for the pandas documentation sprint):

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@pep8speaks
Copy link

pep8speaks commented Mar 10, 2018

Hello @ijmbarr! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on July 08, 2018 at 15:24 Hours UTC

@codecov
Copy link

codecov bot commented Jul 8, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@f90aa44). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #20177   +/-   ##
=========================================
  Coverage          ?    91.7%           
=========================================
  Files             ?      150           
  Lines             ?    49152           
  Branches          ?        0           
=========================================
  Hits              ?    45074           
  Misses            ?     4078           
  Partials          ?        0
Flag Coverage Δ
#multiple 90.08% <ø> (?)
#single 41.84% <ø> (?)
Impacted Files Coverage Δ
pandas/core/indexes/accessors.py 90.19% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f90aa44...d1ddfb2. Read the comment docs.

@WillAyd WillAyd merged commit b058e37 into pandas-dev:master Jul 8, 2018
@WillAyd
Copy link
Member

WillAyd commented Jul 8, 2018

Thanks @ijmbarr !

Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants